package edu.ucdavis.gwt.gis.client.toolbar.button;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.Image;

import edu.ucdavis.gwt.gis.client.export.PrintMapPopup;
import edu.ucdavis.gwt.gis.client.resources.GadgetResources;
import edu.ucdavis.gwt.gis.client.toolbar.Toolbar;

public class ExportMapButton extends ToolbarItem {
	
	private PrintMapPopup popup = new PrintMapPopup();
	
	@Override
	public Image getIcon() {
		Image img = new Image(GadgetResources.INSTANCE.exportMap());
		img.setTitle("Export Map");
		return img;
	}

	@Override
	public void onAdd(Toolbar toolbar) {}

	@Override
	public void onClick(ClickEvent event) {
		popup.initAndShow();
	}

	@Override
	public String getText() {
		return "Export Map";
	}

}
